<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0px;
            padding: 0px;
        }

        li {
            list-style: none;
        }

        .bw {
            margin: 100px auto;
            background-color: #fff;
            width: 420px;
            padding-top: 3px;
        }

        .bw li {
            float: left;
            margin: 0 1px;
            cursor: pointer;
        }

        .bw img {
            width: 100px;
        }

        body {
            background: url(images/1.png) no-repeat center top;
        }
    </style>
</head>

<body>
    <ul class="bw">
        <li><img src="images/1.png" alt=""></li>
        <li><img src="images/2.png" alt=""></li>
        <li><img src="images/3.png" alt=""></li>
        <li><img src="images/4.png" alt=""></li>
    </ul>

    <script>
        const imgAll = document.querySelectorAll("img");
        for (const img of imgAll) {
            img.onclick = function () {
                document.body.style.backgroundImage = 'url(' + this.src + ')'
            }
        }
    </script>
</body>

</html>